<template>
  <div class="page-container" >
    <div class="toolbar" style="padding-top:10px;padding-left:15px;" >
        <el-steps :active="active" align-center>
          <el-step title="基本信息" description=""></el-step>
          <el-step title="资质证书" description=""></el-step>
          <el-step title="提交申请" description=""></el-step>
        </el-steps>
        <el-row style="text-align: center;" v-show="active==1">
          <!-- table切换 -->
          <el-form :inline="true" :model="supplierInformationForm" label-width="110px" style="text-align:center;" ref="supplierInformationForm" :rules="dataFormRules" :size="size" class="form">
            <el-row style="margin-top: -20px;">
              <el-form-item label="ID" prop="id" v-if="false">
                <el-input v-model="dataForm.id" :disabled="true" auto-complete="off"></el-input>
              </el-form-item>
              <el-divider content-position="center">
                  <span style="font-size:16px;font-weight:800">
                    供应商基本信息
                  </span>
              </el-divider> 
              <el-form-item label="供应商助记码"  prop="supplierMnemonicCode">
                <el-input v-model="supplierInformationForm.supplierMnemonicCode" auto-complete="off" maxlength="30"></el-input>
              </el-form-item>
              <el-form-item label="账号"  prop="account">
                <el-input v-model="supplierInformationForm.account" auto-complete="off"></el-input>
              </el-form-item>
              <el-form-item label="密码"  prop="password">
                <el-input v-model="supplierInformationForm.password" auto-complete="off" show-password maxlength="18"></el-input>
              </el-form-item>
            </el-row>
            <el-row style="margin-top: -20px;">
            <el-divider content-position="center">
                <span style="font-size:16px;font-weight:800">公司信息</span>
            </el-divider>
            <el-form-item label="供应商名称"  prop="supplierName">
              <el-input v-model="supplierInformationForm.supplierName" auto-complete="off" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="供应商简称"  prop="supplierAbbreviation">
              <el-input v-model="supplierInformationForm.supplierAbbreviation" auto-complete="off" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="供应商GLN码"  prop="supplierGlnCode">
              <el-input v-model="supplierInformationForm.supplierGlnCode" auto-complete="off" maxlength="30"></el-input>
            </el-form-item>
            <el-form-item label="企业品牌名称"  prop="enterpriseBrandName">
              <el-input v-model="supplierInformationForm.enterpriseBrandName" auto-complete="off" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="合作方式"  prop="cooperationMethod">
              <el-select v-model="supplierInformationForm.cooperationMethod">
                  <el-option
                    v-for="item in cooperationMethodList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="采购方式"  prop="purchasingMethod">
              <el-select v-model="supplierInformationForm.purchasingMethod">
                  <el-option
                    v-for="item in purchasingMethodList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="交易币别"  prop="transactionCurrency">
              <el-select v-model="supplierInformationForm.transactionCurrency">
                  <el-option
                    v-for="item in transactionCurrencyList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id"
                  ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="企业类型"  prop="enterpriseType">
              <el-select v-model="supplierInformationForm.enterpriseType" style="width:880px">
                <el-option label="国有企业" value="1">国有企业</el-option>
                <el-option label="集体企业" value="2">集体企业</el-option>
                <el-option label="股份制企业" value="3">股份制企业</el-option>
                <el-option label="中外合资企业" value="4">中外合资企业</el-option>
                <el-option label="民营企业" value="5">民营企业</el-option>
                <el-option label="外商独资企业" value="6">外商独资企业</el-option>
                <el-option label="其他" value="7">其他</el-option>
              </el-select>
            </el-form-item>
            </el-row>

            <el-row style="margin-top: -20px;">
            <el-divider content-position="center">
                <span style="font-size:16px;font-weight:800">
                  联系信息
                </span>
            </el-divider>
            
            <el-form-item label="公司网址"  prop="companyWebsite" >
              <el-input v-model="supplierInformationForm.companyWebsite" auto-complete="off" maxlength="50"></el-input>
            </el-form-item>
            <el-form-item label="公司邮箱"  prop="companyEmail"  >
              <el-input v-model="supplierInformationForm.companyEmail" auto-complete="off" maxlength="30"></el-input>
            </el-form-item>
            <el-form-item label="联系电话"  prop="contactNumber" >
              <el-input v-model="supplierInformationForm.contactNumber" auto-complete="off" maxlength="20"></el-input>
            </el-form-item>
            <el-form-item label="传真号码"  prop="faxNumber" >
              <el-input v-model="supplierInformationForm.faxNumber" auto-complete="off" maxlength="20"></el-input>
            </el-form-item>
            </el-row>
          </el-form>
          <div class="item clearfix pt_10 mb_0">
            <el-checkbox id="check" type="checkbox" style="color: red" class="el-checkbox"></el-checkbox>
            <label for="js-mobile-check" class="txt_check_label gray">
                          我已阅读并同意
              <span @click="aleryTerm()">
                  <font color="blue">《{{this.terms}}》</font>
                </span>
            </label>
            <div slot="footer" class="dialog-footer" style="text-align:center">
              <br>
              <br>
              <el-button :size="size" type="primary" @click.native="returnLogin()">取消</el-button>
              <el-button :size="size" type="primary" @click.native="nextStep(1,'supplierInformationForm')">下一步</el-button>
            </div>
          </div>
          <el-dialog title="供应商入驻条款" width="40%" :center="true" :visible.sync="termModel" :close-on-click-modal="false">
            <el-form label-width="100px" :size="size" label-position="right" inline>
              <div class="contentStyle" v-html="content"></div>
            </el-form>
            <div slot="footer" class="dialog-footer" style="text-align:center">
              <el-button :size="size" @click="clearTermModel">{{$t('action.cancel')}}</el-button>
            </div>
          </el-dialog>
        </el-row>
        <el-row style="text-align: center;" v-show="active==2">
          <el-form :inline="true" :model="businessLicenseForm" label-width="110px" style="text-align:center;" ref="businessLicenseForm" :rules="businessLicenseFormRules" :size="size" class="form">
            <el-row style="margin-top: -20px;">
              <el-divider content-position="center">
                  <span style="font-size:16px;font-weight:800">
                    供应商营业执照信息
                  </span>
              </el-divider> 
              <el-form-item label="公司名称" label-width="210px"  prop="companyName">
                <el-input v-model="businessLicenseForm.companyName" auto-complete="off" maxlength="50"></el-input>
              </el-form-item>
              <el-form-item label="企业税号" label-width="210px" prop="corporateTaxNumber">
                <el-input v-model="businessLicenseForm.corporateTaxNumber" auto-complete="off" maxlength="30"></el-input>
              </el-form-item>
              <el-form-item label="法定代表人" label-width="210px" prop="legalRepresentative">
                <el-input v-model="businessLicenseForm.legalRepresentative" auto-complete="off" maxlength="30"></el-input>
              </el-form-item>
              <el-form-item label="营业执照号码" label-width="210px" prop="businessLicenseNumber">
                <el-input v-model="businessLicenseForm.businessLicenseNumber" auto-complete="off" maxlength="50"></el-input>
              </el-form-item>
              <el-form-item label="企业编码" label-width="210px" prop="enterpriseCode">
                <el-input v-model="businessLicenseForm.enterpriseCode" auto-complete="off" maxlength="50"></el-input>
              </el-form-item>
              <el-form-item label="企业注册资金" label-width="210px" prop="enterpriseRegisteredCapital">
                <el-input v-model="businessLicenseForm.enterpriseRegisteredCapital" auto-complete="off" maxlength="18"></el-input>
              </el-form-item>
              <el-form-item label="邮政编码" label-width="210px" prop="postalCode">
                <el-input v-model="businessLicenseForm.postalCode" auto-complete="off" maxlength="30"></el-input>
              </el-form-item>
              <el-form-item label="注册地址" label-width="210px" prop="registeredAddress">
                <el-input v-model="businessLicenseForm.registeredAddress" auto-complete="off" maxlength="50"></el-input>
              </el-form-item>
              <el-form-item label="省名称" label-width="210px" prop="provinceName">
                <el-input v-model="businessLicenseForm.provinceName" auto-complete="off" maxlength="20"></el-input>
              </el-form-item>
              <el-form-item label="市名称" label-width="210px" prop="cityName">
                <el-input v-model="businessLicenseForm.cityName" auto-complete="off" maxlength="20"></el-input>
              </el-form-item>
              <el-form-item label="县/区" label-width="210px" prop="areaName">
                <el-input v-model="businessLicenseForm.areaName" auto-complete="off" maxlength="20"></el-input>
              </el-form-item>
              <el-form-item label="详细地址" label-width="210px" prop="address">
                <el-input v-model="businessLicenseForm.address" auto-complete="off" maxlength="50"></el-input>
              </el-form-item>
              <el-col style="width: 62%;">
                <el-form-item label="证件有效开始时间" label-width="237px" prop="credentialsStartingTime">
                  <el-date-picker v-model="businessLicenseForm.credentialsStartingTime" :editable="false" type="datetime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="开始时间" clearable @change="changeStartDate" :picker-options="startDateDisabled"></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col style="width: 62%;">
                <el-form-item label="证件有效结束时间" label-width="237px" prop="credentialsEndTime">
                  <el-date-picker v-model="businessLicenseForm.credentialsEndTime" :editable="false" type="datetime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="结束时间" clearable @change="changeEndDate" :picker-options="endDateDisabled" ></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col style="width: 62%;">
                <el-form-item label="执照有效开始时间" label-width="237px" prop="licenseStartingTime">
                  <el-date-picker v-model="businessLicenseForm.licenseStartingTime" :editable="false" type="datetime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="开始时间" clearable  @change="changeLicenseStartDate" :picker-options="startDateLicenseDisabled" ></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col style="width: 62%;">
                <el-form-item label="执照有效结束时间" label-width="237px" prop="licenseEndTime">
                  <el-date-picker v-model="businessLicenseForm.licenseEndTime" :editable="false" type="datetime" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="结束时间" clearable @change="changeLicenseEndDate" :picker-options="endDateLicenseDisabled" ></el-date-picker>
                </el-form-item>
              </el-col>
              <el-form-item label="主营品类" label-width="210px" prop="mainCategories">
                <el-input v-model="businessLicenseForm.mainCategories" auto-complete="off"  maxlength="100"></el-input>
              </el-form-item>
              </el-row>
              <el-row style="margin-top: -20px;">
                <el-divider content-position="center">
                    <span style="font-size:16px;font-weight:800">
                      证件图片
                    </span>
                </el-divider>
                <el-col style="width: 62%;">
                  <el-form-item label="营业执照附件" label-width="210px" prop="businessLicenseAttachment">
                    <el-upload
                      class="avatar-uploader"
                      style="border: 1px dashed #d9d9d9; border-radius: 6px;  cursor: pointer;  position: relative;  overflow: hidden;"
                      :action="uploadImgUrl"
                      :show-file-list="false"
                      :on-success="businessLicenseAttachmentSuccess"
                      :before-upload="beforeAvatarUpload">
                      <img v-if="businessLicenseForm.businessLicenseAttachment" :src="businessLicenseForm.businessLicenseAttachment" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
                <el-col style="width: 62%;">
                  <el-form-item label="法定代表人证件正面（国徽面）" label-width="210px" prop="legalRepresentativePositive">
                    <el-upload
                      class="avatar-uploader"
                      style="border: 1px dashed #d9d9d9; border-radius: 6px;  cursor: pointer;  position: relative;  overflow: hidden;"
                      :action="uploadImgUrl"
                      :show-file-list="false"
                      :on-success="legalRepresentativePositiveSuccess"
                      :before-upload="beforeAvatarUpload">
                      <img v-if="businessLicenseForm.legalRepresentativePositive" :src="businessLicenseForm.legalRepresentativePositive" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
                <el-col style="width: 62%;">
                  <el-form-item label="法定代表人证件反面（头像面）" label-width="210px" prop="legalRepresentativeObverse">
                    <el-upload
                      class="avatar-uploader"
                      style="border: 1px dashed #d9d9d9; border-radius: 6px;  cursor: pointer;  position: relative;  overflow: hidden;"
                      :action="uploadImgUrl"
                      :show-file-list="false"
                      :on-success="legalRepresentativeObverseSuccess"
                      :before-upload="beforeAvatarUpload">
                      <img v-if="businessLicenseForm.legalRepresentativeObverse" :src="businessLicenseForm.legalRepresentativeObverse" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
            </el-row>
          </el-form>
          <div class="item clearfix pt_10 mb_0">
            <div slot="footer" class="dialog-footer" style="text-align:center">
              <br>
              <br>
              <el-button :size="size" type="primary" @click.native="upStep(2)">上一步</el-button>
              <el-button :size="size" type="primary" @click.native="nextStep(2,'businessLicenseForm')">下一步</el-button>
            </div>
          </div>
        </el-row>
        <el-row style="text-align: center;" v-show="active==3">
          <div style="height:100px">
            <label
              class="col-sm-7 control-label ng-binding"
              style="font-family: 'Arial Negreta', 'Arial';font-weight: 700;font-style: normal;font-size: 32px;color: #333333;"
            >申请成功，请耐心等待审核</label>
            <img v-bind:src="activeImgUrl" />
          </div>
          <div style="text-align:center;padding-top:130px;">
                <!-- <el-button :size="size" type="primary" @click.native="upStep(2)">上一步</el-button> -->
            <el-button :size="size" type="primary" @click="returnLogin">返回登录页</el-button>
          </div>
        </el-row>
    </div>
    
  </div>
</template>

<script>
import { mapState } from "vuex";
import Cookies from "js-cookie";
import ThemePicker from "@/components/ThemePicker";
import LangSelector from "@/components/LangSelector";
import Vue from "vue";
import VDistpicker from 'v-distpicker';
import {validatePhone,validateContacts,isEmail,isNumber} from '@/utils/validate'

export default {
  name: "Login",
  components: {
    ThemePicker,
    LangSelector,
    VDistpicker,
  },
  data() {
    return {
      activeImgUrl: "/static/u16.png",
      imgUrl: this.utils.imgUrl,//图片地址拼接
      uploadImgUrl: this.utils.uploadImgUrl,//图片地址拼接
      purchasingMethodList:[//采购方式
        {id:1,name:'普通采购'}
      ],
      cooperationMethodList:[//合作方式
        {id:1,name:'经销'},
        {id:2,name:'代销'},
      ],
      transactionCurrencyList:[//交易币别
        {id:1,name:'CNY'},
        {id:2,name:'AUD'},
        {id:3,name:'USD'},
        {id:4,name:'GBP'},
      ],
      active:2,
      termModel: false,
      content:"",
      terms:"",
      size: "small",
      dataFormRules: {
        supplierMnemonicCode: [{required: true, message: "请输入供应商助记码", trigger: "blur"}],
        account: [{required: true, message: "请输入账号", trigger: "blur"}],
        password: [{required: true, message: "请输入密码", trigger: "blur"}],
        supplierName: [{required: true, message: "请输入供应商名称", trigger: "blur"}],
        supplierAbbreviation: [{required: true, message: "请输入供应商简称", trigger: "blur"}],
        supplierGlnCode: [{required: true, message: "请输入供应商GLN码", trigger: "blur"}],
        enterpriseBrandName: [{required: true, message: "请输入企业品牌名称", trigger: "blur"}],
        purchasingMethod: [{required: true, message: "请选择采购方式", trigger: "change"}],
        cooperationMethod: [{required: true, message: "请选择合作方式", trigger: "change"}],
        transactionCurrency: [{required: true, message: "请选择交易币别", trigger: "change"}],
        enterpriseType: [{required: true, message: "请选择企业类型", trigger: "change"}],
        companyEmail: [{required: true, message: "请输入公司邮箱", trigger: "blur"}],
        companyWebsite: [{required: true, message: "请输入公司网址", trigger: "blur"}],
        contactNumber: [{required: true, message: "请输入联系电话", trigger: "blur"}],
        faxNumber: [{required: true, message: "请输入传真号码", trigger: "blur"}],
      },
      supplierInformationForm:{
        supplierName:'',
        supplierAbbreviation:'',
        supplierMnemonicCode:'',
        supplierGlnCode:'',
        enterpriseType:'',
        companyEmail:'',
        companyWebsite:'',
        contactNumber:'',
        faxNumber:'',
        enterpriseBrandName:'',
        transactionCurrency:'',
        purchasingMethod:'',
        cooperationMethod:'',
        supplierMnemonicCode: '',
        account: '',
        password: '',
        supplierName:'',
        supplierAbbreviation: '',
        supplierGlnCode:'',
        enterpriseBrandName:'',
        purchasingMethod:'',
        cooperationMethod:'',
        transactionCurrency:'',
        enterpriseType:'',
        companyEmail:'',
        companyWebsite:'',
        contactNumber:'',
        faxNumber:'',
      },
      startDateDisabled: {},//开始时间限制
      endDateDisabled: {},//结束时间限制
      startDateLicenseDisabled: {},//开始时间限制
      endDateLicenseDisabled: {},//结束时间限制
      businessLicenseForm:{
        companyName: '',
        corporateTaxNumber: '',
        legalRepresentative: '',
        businessLicenseNumber: '',
        enterpriseCode: '',
        enterpriseRegisteredCapital: '',
        postalCode: '',
        registeredAddress: '',
        address: '',
        provinceName: '',
        cityName: '',
        areaName: '',
        credentialsStartingTime: '',
        credentialsEndTime: '',
        licenseStartingTime: '',
        licenseEndTime: '',
        mainCategories: '',
        businessLicenseAttachment: '',
        legalRepresentativePositive: '',
        legalRepresentativeObverse: '',
      },
      businessLicenseFormRules:{
        companyName: [{required: true, message: "请输入公司名称", trigger: "blur"}],
        corporateTaxNumber: [{required: true, message: "请输入企业税号", trigger: "blur"}],
        legalRepresentative: [{required: true, message: "请输入法定代表人", trigger: "blur"}],
        businessLicenseNumber: [{required: true, message: "请输入营业执照号码", trigger: "blur"}],
        enterpriseCode: [{required: true, message: "请输入企业编码", trigger: "blur"}],
        enterpriseRegisteredCapital: [{required: true, message: "请输入企业注册资金", trigger: "blur"}],
        postalCode: [{required: true, message: "请输入邮政编码", trigger: "blur"}],
        registeredAddress: [{required: true, message: "请输入注册地址", trigger: "blur"}],
        address: [{required: true, message: "请输入详细地址", trigger: "blur"}],
        provinceName: [{required: true, message: "请输入省名称", trigger: "blur"}],
        cityName: [{required: true, message: "请输入市名称", trigger: "blur"}],
        areaName: [{required: true, message: "请输入区县", trigger: "blur"}],
        credentialsStartingTime: [{required: true, message: "请选择证件有效开始时间", trigger: "change"}],
        credentialsEndTime: [{required: true, message: "请选择证件有效结束时间", trigger: "change"}],
        licenseStartingTime: [{required: true, message: "请选择执照有效开始时间", trigger: "change"}],
        licenseEndTime: [{required: true, message: "请选择执照有效结束时间", trigger: "change"}],
        mainCategories: [{required: true, message: "请输入主营品类", trigger: "blur"}],
        businessLicenseAttachment: [{required: true, message: "请上传营业执照附件", trigger: "change"}],
        legalRepresentativePositive: [{required: true, message: "请上传法定代表人证件正面（国徽面）", trigger: "change"}],
        legalRepresentativeObverse: [{required: true, message: "请上传法定代表人证件反面（头像面）", trigger: "change"}],
      },
      checked: true,
    };
  },
  methods: {
    changeStartDate: function() {
      var this_ = this;
      this_.endDateDisabled = {
        disabledDate: time => {
          if (this_.businessLicenseForm.credentialsStartingTime) {
            return time.getTime() <= new Date(this_.businessLicenseForm.credentialsStartingTime).getTime();
          }
        }
      };
    },
    changeEndDate: function() {
      var this_ = this;
      this_.startDateDisabled = {
        disabledDate: time => {
          if (this_.businessLicenseForm.credentialsEndTime) {
            return time.getTime() >= new Date(this_.businessLicenseForm.credentialsEndTime).getTime();
          }
        }
      };
    },
    changeLicenseStartDate: function() {
      var this_ = this;
      this_.endDateLicenseDisabled = {
        disabledDate: time => {
          if (this_.businessLicenseForm.licenseStartingTime) {
            return time.getTime() <= new Date(this_.businessLicenseForm.licenseStartingTime).getTime();
          }
        }
      };
    },
    changeLicenseEndDate: function() {
      var this_ = this;
      this_.startDateLicenseDisabled = {
        disabledDate: time => {
          if (this_.businessLicenseForm.licenseEndTime) {
            return time.getTime() >= new Date(this_.businessLicenseForm.licenseEndTime).getTime();
          }
        }
      };
    },
    businessLicenseAttachmentSuccess(res, file) {
      let val = this.utils.imgUrl + res.data.fileId;
      console.log(val);
      this.businessLicenseForm.businessLicenseAttachment = val;
    },
    legalRepresentativePositiveSuccess(res, file) {
      let val = this.utils.imgUrl + res.data.fileId;
      this.businessLicenseForm.legalRepresentativePositive = val;
    },
    legalRepresentativeObverseSuccess(res, file) {
      let val = this.utils.imgUrl + res.data.fileId;
      this.businessLicenseForm.legalRepresentativeObverse = val;
    },
    beforeAvatarUpload(file) {
      const isJPG = file.type === 'image/jpeg' || 'image/png';
      const isLt2M = file.size / 1024 / 1024 < 2;

      if (!isJPG) {
        this.$message.error('上传图片只能是 JPG或PNG 格式!');
      }
      if (!isLt2M) {
        this.$message.error('上传图片大小不能超过 2MB!');
      }
      return isJPG && isLt2M;
    },
    //入驻条款查询
    getTermsInfo() {
      let this_ = this;
      let param = {};
      param.entryType = 3;
      this.utils.request.getTermsInfo(param, function(res) {
        if (res.data != null) {
          this_.terms = res.data.title;
          console.log(res.data);
          this_.content = res.data.content;
        }
      });
    },
    //入驻条款查看
    aleryTerm: function(data) {
      let this_ = this;
      this_.termModel = true;
    },
    //入驻条款关闭
    clearTermModel: function(data) {
      let this_ = this;
      this_.termModel = false;
    },
    //取消返回登录页面
    returnLogin(){
      this.$router.push("/login"); 
    },
    //上一步
    upStep(data) {
      if (data == 2) {
       this.active =1;
      }
    },
    //下一步
    nextStep(data,dataForm) {
      let this_=this
      if (data == 1) {//将数据保存 进入下一步添加资质证书
        this_.$refs[dataForm].validate((valid) => {
            if (valid) {
              if ($(".el-checkbox input[type='checkbox']").is(':checked') == false) {
                this.$message({message: '请阅读并勾选'+'《'+this.terms+'》', type: 'error'});return;
              }
              this.editLoading = true;
              let params = Object.assign({}, this.supplierInformationForm);
              this.merchantsSettledFrom = Object.assign({}, params);
              this.active =2;
            } else {
              return false;
            }
        });
      } else if (data == 2) {//将数据提交审核
        this_.$refs[dataForm].validate((valid) => {
            if (valid) {
              let params = Object.assign({}, this.businessLicenseForm);
              this_.merchantsSettledFrom.businessLicense =  params;
              this_.utils.request.suppliersSettledIn(this.merchantsSettledFrom,res=>{
                if(res.code == '0000'){
                  this_.active =3;
                }
              });
            } else {
              return false;
            }
        });
        
      }
    },
  },
  mounted() {
    this.getTermsInfo();
  },
  computed: {
    ...mapState({
      themeColor: state => state.app.themeColor
    })
  }
};


</script>

<style lang="scss" scoped>
.login-container {
  -webkit-border-radius: 5px;
  border-radius: 5px;
  -moz-border-radius: 5px;
  background-clip: padding-box;
  margin: 100px auto;
  width: 350px;
  padding: 35px 35px 15px 35px;
  background: #fff;
  border: 1px solid #eaeaea;
  box-shadow: 0 0 25px #cac6c6;
  .title {
    margin: 0px auto 30px auto;
    text-align: center;
    color: #505458;
  }
  .remember {
    margin: 0px 0px 35px 0px;
  }
   .el-tree-node{
      .el-tree-node__content>label.el-checkbox {
          display: none;
      }
  }
}
</style>
<style  scoped>
/deep/ .form .el-input__inner {
  width: 880px !important;
}
.form .el-textarea__inner {
  width: 880px !important;
}
 .form .item {
    padding: -5px 0;
  }
  /deep/.distpicker-address-wrapper select {
    padding: .5rem .75rem;
    height: 34px;
    font-size: 0.8rem;
    width: 290px;
}
.form .el-form-item--small.el-form-item {
    margin-bottom: 13px;
}
.contentStyle {
  position: relative;
  padding: 15px 0px 15px 0px;
  max-height: 600px;
  overflow-y: scroll;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409EFF;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>
